package com.irdstudio.efp.report.service.impl;

import com.irdstudio.basic.framework.core.base.FrameworkService;
import com.irdstudio.efp.report.service.dao.AccLoanYearTotalTempDao;
import com.irdstudio.efp.report.service.domain.AccLoanYearTotalTemp;
import com.irdstudio.efp.report.service.facade.AccLoanYearTotalTempService;
import com.irdstudio.efp.report.service.vo.AccLoanYearTotalTempVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 需求编号:2020D1004
 * 问题编号:
 * 开发人员: wengqw
 * 创建日期:2020/7/9
 * 功能描述:
 * 修改日期:2020/7/9
 * 修改描述:
 */
@Service("accLoanYearTotalTempService")
public class AccLoanYearTotalTempServiceImpl implements AccLoanYearTotalTempService, FrameworkService {

    private static Logger logger = LoggerFactory.getLogger(AccLoanYearTotalTempServiceImpl.class);

    @Autowired
    private AccLoanYearTotalTempDao accLoanYearTotalTempDao;

    /**
     * 统计当年累计放款额度
     *
     * @return
     */

    @Override
    public AccLoanYearTotalTempVo getAccLoanYearTotal(String channelCode, int startBalance, int endBalance) {
        logger.debug("当前查询数据信息的参数信息为:");
        AccLoanYearTotalTempVo accLoanYearTotalTempVo = new AccLoanYearTotalTempVo();
        try {
            AccLoanYearTotalTemp accLoanYearTotalTemp = accLoanYearTotalTempDao.getAccLoanYearTotalTemp(channelCode, startBalance, endBalance);
            accLoanYearTotalTempVo = beanCopy(accLoanYearTotalTemp, accLoanYearTotalTempVo);
        } catch (Exception e) {
            logger.error("数据转换出现异常!", e);
        }
        return accLoanYearTotalTempVo;
    }

    @Override
    public AccLoanYearTotalTempVo getAccLoanYearTotalForBd(int startBalance, int endBalance) {
        logger.debug("当前查询数据信息的参数信息为:");
        AccLoanYearTotalTempVo accLoanYearTotalTempVo = new AccLoanYearTotalTempVo();
        try {
            AccLoanYearTotalTemp accLoanYearTotalTemp = accLoanYearTotalTempDao.getAccLoanYearTotalTempForBd(startBalance, endBalance);
            accLoanYearTotalTempVo = beanCopy(accLoanYearTotalTemp, accLoanYearTotalTempVo);
        } catch (Exception e) {
            logger.error("数据转换出现异常!", e);
        }
        return accLoanYearTotalTempVo;
    }
}
